package com.ruoyi.management.helper;

import com.ruoyi.management.mock.domain.TNotice;
import com.ruoyi.management.mock.ro.AddNoticeParam;
import com.ruoyi.management.mock.ro.UpdateNoticeParam;

/**
 *
 */
public class NoticeServiceHelper {
    private NoticeServiceHelper() {
    }

    public static TNotice addNoticeParam2TNotice(AddNoticeParam param) {
        TNotice notice = new TNotice();
        notice.setTitle(param.getTitle());
        notice.setPlatform(param.getPlatform());
        notice.setStatus(param.getStatus());
        notice.setType(param.getType());
        notice.setContent(param.getContent());
        notice.setIsTop(param.getIsTop());
        notice.setIsHot(param.getIsHot());
        notice.setIsBanner(param.getIsBanner());
        notice.setBannerUrl(param.getBannerUrl());
        notice.setDeptId(param.getDeptId());
        notice.setCompanyId(param.getCompanyId());
        notice.setCreateUser(param.getCreateUser());
        if (null != param.getDownTime())
        {
            //otice.setDownTime(param.getDownTime());
        }
        if (null != param.getCategory())
        {
            notice.setCategory(param.getCategory());
        }

        return notice;
    }


    public static TNotice updateNoticeParam2TNotice(UpdateNoticeParam param, TNotice notice) {
        notice.setTitle(param.getTitle());
        notice.setPlatform(param.getPlatform());
        notice.setStatus(param.getStatus());
        notice.setType(param.getType());
        notice.setContent(param.getContent());
        notice.setIsTop(param.getIsTop());
        notice.setIsHot(param.getIsHot());
        notice.setIsBanner(param.getIsBanner());
        notice.setBannerUrl(param.getBannerUrl());
        notice.setDeptId(param.getDeptId());
        notice.setCompanyId(param.getCompanyId());
        notice.setCreateUser(param.getCreateUser());
        if (null != param.getDownTime())
        {
            //notice.setDownTime(param.getDownTime());
        }
        if (null != param.getCategory())
        {
            notice.setCategory(param.getCategory());
        }
        return notice;
    }
}
